package main

import (
	"context"
	"fmt"
	pb "gateway_demo/gen/go/your/service/v1"
	"log"

	"google.golang.org/grpc"
)

func main() {

	serverAddr := "127.0.0.1:9091"

	conn, err := grpc.Dial(serverAddr, grpc.WithInsecure())
	if err != nil {
		log.Fatalf("fail to dial: %v", err)
	}

	defer conn.Close()
	client := pb.NewYourServiceClient(conn)

	req := new(pb.StringMessage)
	req.Value = "User_Info"

	resp, err := client.Echo(context.Background(), req)

	if err != nil {
		fmt.Printf("GetUserInfo err %v", err)
	}
	fmt.Printf("UserInfo        %v \n", resp.Value)

	fmt.Printf("TaskInfo        %v \n", resp)
}
